package sjms.construction.proxy.staticP;

/**
 * @ClassName:
 * @Description:
 * @Author fcb
 * @Date 2020/6/5 12:08
 */
public class TargetProxy implements Shape {

    private Shape target;

    public TargetProxy(Target target){
        this.target = target;
    }

    private void before(){
        System.out.println("before");
    }

    private void after(){
        System.out.println("after");
    }

    @Override
    public void draw() {
        System.out.println("代理类执行");
        this.before();
        target.draw();
        this.after();
    }
}
